# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=volatility3
pkgver=2.5.0
pkgrel=0
pkgdesc="Volatile memory forensics toolkit"
url="https://github.com/volatilityfoundation/volatility3"
arch="noarch !armhf !armv7" # py3-yara
license="custom"
depends="py3-crypto py3-capstone py3-yara py3-pefile"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-doc $pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/volatilityfoundation/volatility3/archive/v$pkgver.tar.gz"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 setup.py check
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl

	install -Dm644 LICENSE.txt \
		-t "$pkgdir"/usr/share/licenses/$pkgname/

	cd "$pkgdir"/usr/lib/python3*/site-packages
	rm -r doc test
}

sha512sums="
efe7799c57fd4d8970c50c96a05d83a161149a26f944963e66af33e46a8fc6e524b67db0ac6b5e2bba93ff1d116e84d2d902398c02311c9504f4da7b85e49109  volatility3-2.5.0.tar.gz
"
